import React from 'react';
// import "./herder.css"
class Heaser extends React.Component {
    state = {
        heaarr: ["js", "html", "css", "react"],
        index: 0

    }
    fn = (i) => {
        return () => {
            this.setState({
                index: i
            })

        }
    }
    render() {
        return <ul className='hea'>
            {
                this.state.heaarr.map((iteam, index) => {
                    return <li onClick={this.fn(index)} className={this.state.index === index ? "bg" : null} key={index}>{iteam}</li>

                })
            }
        </ul>
    }
}
export default Heaser